<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

<ui:composition>
	<h:form>
		<rich:dataTable id="continueShoppingPanel" style="width:100%;"
			iterationStatusVar="it" value="#{basketBean.book_list}" var="var">
			<rich:column>
				#{it.index+1}
			</rich:column>

			<rich:column>
				<f:facet name="header">
				Tytuł
            </f:facet>
				<h:outputText value="#{var.book.title}" styleClass="cartDataStyle" />
			</rich:column>
			<rich:column>
				<f:facet name="header">
				Autorzy
            </f:facet>
				<rich:list value="#{var.book.author_list}" var="author"
					styleClass="bookAuthorsCart">
					<h:outputText
						value="#{author.author_first_name} #{author.author_last_name}"
						styleClass="cartDataStyle" />
				</rich:list>
			</rich:column>


			<rich:column>
				<f:facet name="header">
				ISBN
            </f:facet>
				<h:outputText value="#{var.book.isbn}" styleClass="cartDataStyle" />
			</rich:column>

			<rich:column>
				<f:facet name="header">
				Cena
            </f:facet>
				<h:outputText value="#{var.book.price}" styleClass="bookPriceCart">
					<f:convertNumber type="currency" pattern="  #0.00 zł" />
				</h:outputText>
			</rich:column>

			<rich:column>
				<f:facet name="header">
				Liczba sztuk
            </f:facet>
				<h:outputText value="#{var.books_in_basket}" size="1"
					styleClass="cartDataStyle" />
			</rich:column>


			<f:facet name="footer">
                Suma: <h:outputText value="#{basketBean.price}">
					<f:convertNumber type="currency" pattern="  #0.00 zł" />
				</h:outputText>
			</f:facet>
		</rich:dataTable>
		<h:panelGrid cellspacing="10" columns="2"
			style="margin-left: auto; margin-right: auto;">
			<h:commandButton value="Zatwierdź"
				actionListener="#{basketBean.confirmOrder}" action="apply" />

			<h:commandButton value="Anuluj"
				action="#{jsfutils.redirect('mainContent/booksTablePage')}" />
		</h:panelGrid>
	</h:form>
</ui:composition>
</html>
